<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
    <head>
        <link rel="stylesheet" type="text/css" href="login.css">
        <link rel="stylesheet" type="text/css" href="estilo.css">
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <title>Cadastro Funcionário</title>
    </head>
    <?php
    session_start();
    if (isset($_SESSION['funcionario'])) {
        $funcionarios = $_SESSION['funcionario'];
    }
    ?>

    <?
    function mask($val, $mask) {
        $maskared = '';
        $k = 0;
        for ($i = 0; $i <= strlen($mask) - 1; $i++) {
            if ($mask[$i] == '#') {
                if (isset($val[$k]))
                    $maskared .= $val[$k++];
            }
            else {
                if (isset($mask[$i]))
                    $maskared .= $mask[$i];
            }
        }
        return $maskared;
    }
    ?>

    <?
    $cpf = "09870987";
    echo mask($cpf, '###.###.###-##');
    ?>

    <body>   
        <div id="site">
<?php include '../helper/cabecalho.php'; ?>
            <div id="login">
                <h1>Cadastro Funcionário</h1>
                <table style="text-align: center" width="200">
                    <form style="margin-left: 40%;" align="center" target="_blank" action="../cadastrar.php" method="post">
                        <table>
                            Nome <br />
                            <input name="nome" type="text" size="30"><br />
                            Cpf <br />
                            <input name="cpf" type="text"></br >
                            Login <br />
                            <input name="login" type="text"></br >
                            Senha <br />
                            <input name="senha" type="password"><br />
                            Confirme sua senha <br />
                            <input name="confirma" type="password"><br />
                            Permissão <br /> 
                            <select name="permissao"><br />
                                <option value=0>selecione sua permissão</option>
                                <option value=1>Cliente</option>
                            </select><br /><br /><br />
                            <input type="submit" value="cadastrar-se">
                        </table>
                    </form>
            </div>
<?php include '../helper/rodape.php'; ?>
        </div>
    </body>
</html>
